package com.kaishengit.pms.web;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.kaishengit.pms.entity.Goal;
import com.kaishengit.pms.service.ShowtaskService;

public class UpdaterateServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session = request.getSession();
		Goal goal = (Goal) session.getAttribute("goal");
		
		String rate = request.getParameter("rate");
		String taskid = request.getParameter("taskid");
		ShowtaskService showtaskservice = new ShowtaskService();
		showtaskservice.updaterate(taskid,rate);
		
		response.sendRedirect("showtask.jspx?goalid="+goal.getId());
		//request.getRequestDispatcher("WEB-INF/views/showtask.jsp").forward(request, response);
	}
	

}
